package com.iias.common.util.log;


import com.iias.common.util.rect.ReflectionInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogUtils {


    private Logger log = LogUtils.getLogger();

//    public static LoggerSelf getLogger(){
//        StackTraceElement[] stacks = ReflectionInfo.getStack();
//        StackTraceElement stackService = stacks[3];
//        String className = stackService.getClassName();
//        try {
//            return new LoggerSelf(LoggerFactory.getLogger(Class.forName(className)));
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        }
//        return null;
//    }


    public static Logger getLogger(){
        StackTraceElement[] stacks = ReflectionInfo.getStack();
        StackTraceElement stackService = stacks[3];
        String className = stackService.getClassName();
        try {
          return   LoggerFactory.getLogger(Class.forName(className));
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }

}
